<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://xmlns.jcp.org/jsf/passthrough">
<h:body>
	<ui:composition template="/template.xhtml">
		<ui:define name="body">
			<f:event listener="#{userMenu.selectM1G3}" type="preRenderView"></f:event>
			<!-- NAVIGATOR -->
        	<ui:insert><ui:include src="nav.xhtml" /></ui:insert>
        	
			<div class="container">
				<!-- Main component for a primary marketing message or call to action -->
				<div class="row">
					<div class="col-xs-12">
		
						<div class="page-header">
							<h1>
								文章发布数一览 <small>可查询过去和将来的文章发布情况</small>
							</h1>
						</div>
						
						<h:messages infoClass="alert alert-success" errorClass="text-danger" showSummary="false" showDetail="true"></h:messages>
						
						<h:form styleClass="form-horizontal" p:role="form">
							<div class="form-group">
							    <label for="inputMonth" class="control-label col-xs-2">输入年月份(yyyy/MM)</label>
							    <div class="col-xs-10">
							      <h:inputText label="年月份" p:id="inputMonth" p:placeholder="yyyy/MM" styleClass="form-control input-lg" value="#{statisticsAction.queryMonth}">
							      	<f:convertDateTime pattern="yyyy/MM" dateStyle="short" type="date" timeStyle="short" timeZone="GMT+8"></f:convertDateTime>
							      </h:inputText>
							    </div>
							</div>
							<div class="form-group">
								<div class="col-sm-12">
									<h:commandLink action="#{statisticsAction.query}" styleClass="btn btn-primary btn-lg btn-block">
										<span class="glyphicon glyphicon-refresh"></span> 查询指定月份文章发布数统计
									</h:commandLink>
								</div>
							</div>
						</h:form>
						<c:forEach items="#{statisticsAction.queryResult}" var="data">
							<c:if test="#{data[1] eq 0}">
								<div class="alert alert-danger col-xs-3">
									【<h:outputText value="#{data[0]}"></h:outputText>】
									已发表文章数：【<h:outputText value="#{data[1]}"></h:outputText>】
									<!-- 小伙伴们加油增加文章哦，如果用户访问该天的文章会看到空白页哦 ~~ -->
								</div>
							</c:if>
							<c:if test="#{data[1] eq 1}">
								<div class="alert alert-warning col-xs-3">
									【<h:outputText value="#{data[0]}"></h:outputText>】
									已发表文章数：【<h:outputText value="#{data[1]}"></h:outputText>】
									<!-- 如果能再增加1篇本日发布的文章，那便是极好的了~~ -->
								</div>
							</c:if>
							<c:if test="#{data[1] eq 2 || data[1] gt 2}">
								<div class="alert alert-success col-xs-3">
									【<h:outputText value="#{data[0]}"></h:outputText>】
									已发表文章数：【<h:outputText value="#{data[1]}"></h:outputText>】
									<!-- 今日发表的文章数已满足需要，时间会证明我们的付出一定会得到回报！ -->
								</div>
							</c:if>
						</c:forEach>
					</div>
				</div>
				<!-- end row -->
			</div>
			<!-- end container -->
		</ui:define>
	</ui:composition>
</h:body>
</html>